{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "ordinary-pepper",
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "impressive-incentive",
   "metadata": {},
   "source": [
    "1.随机数生成六个班的考试成绩，3门考试：Python、数学、语文。每个班50人"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "exclusive-tenant",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[39, 53, 99],\n",
       "       [60, 21, 91],\n",
       "       [66,  4, 17],\n",
       "       [79, 73, 58],\n",
       "       [56, 47,  7],\n",
       "       [80, 99, 39],\n",
       "       [99, 19, 43],\n",
       "       [ 9, 48, 50],\n",
       "       [76, 64, 55],\n",
       "       [78, 48, 46],\n",
       "       [42, 34, 45],\n",
       "       [29, 43, 21],\n",
       "       [67, 27,  1],\n",
       "       [78, 76,  5],\n",
       "       [59, 70, 95],\n",
       "       [85,  7, 19],\n",
       "       [31,  2, 10],\n",
       "       [27, 27, 98],\n",
       "       [59,  9, 53],\n",
       "       [52, 27, 83],\n",
       "       [ 7, 99, 46],\n",
       "       [95, 76, 90],\n",
       "       [40, 48, 13],\n",
       "       [78, 61, 32],\n",
       "       [25, 21, 95],\n",
       "       [55, 36, 37],\n",
       "       [77, 73, 11],\n",
       "       [83, 11,  6],\n",
       "       [30, 70, 30],\n",
       "       [20, 39, 21],\n",
       "       [90,  0, 23],\n",
       "       [21, 82, 16],\n",
       "       [18, 62, 41],\n",
       "       [67, 22,  8],\n",
       "       [90, 94, 11],\n",
       "       [ 8, 69, 22],\n",
       "       [66, 87, 89],\n",
       "       [63, 96, 22],\n",
       "       [73, 38, 81],\n",
       "       [63, 69, 87],\n",
       "       [71, 67, 41],\n",
       "       [30, 24, 68],\n",
       "       [11, 23,  9],\n",
       "       [88, 51, 68],\n",
       "       [98, 68, 26],\n",
       "       [92,  2, 89],\n",
       "       [45,  2, 14],\n",
       "       [66, 31, 98],\n",
       "       [43, 35, 31],\n",
       "       [93, 35, 69]])"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "class1 = np.random.randint(0, 100, size = (50, 3))\n",
    "class1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "moderate-cause",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[18, 20, 99],\n",
       "       [91, 16, 77],\n",
       "       [12, 83, 81],\n",
       "       [34, 21, 69],\n",
       "       [53, 20, 83],\n",
       "       [56,  1, 56],\n",
       "       [52, 50, 66],\n",
       "       [14,  7, 26],\n",
       "       [70, 85,  6],\n",
       "       [28, 62, 48],\n",
       "       [65, 55, 19],\n",
       "       [75, 61, 57],\n",
       "       [15, 91, 38],\n",
       "       [11, 57, 19],\n",
       "       [32, 91, 93],\n",
       "       [97, 88, 47],\n",
       "       [58, 48, 19],\n",
       "       [53, 75, 74],\n",
       "       [54, 87, 28],\n",
       "       [73, 69, 43],\n",
       "       [34, 60, 18],\n",
       "       [37, 35, 33],\n",
       "       [39, 87, 90],\n",
       "       [97, 66, 42],\n",
       "       [88, 91,  8],\n",
       "       [37, 40, 84],\n",
       "       [11, 16, 29],\n",
       "       [81, 45, 77],\n",
       "       [76, 12, 78],\n",
       "       [46, 30, 73],\n",
       "       [63, 61, 57],\n",
       "       [17,  0, 95],\n",
       "       [45, 13, 57],\n",
       "       [55, 67, 53],\n",
       "       [75,  9,  7],\n",
       "       [30, 12, 90],\n",
       "       [66,  9, 95],\n",
       "       [ 6, 79, 46],\n",
       "       [76, 65, 22],\n",
       "       [11, 78, 92],\n",
       "       [83,  0, 44],\n",
       "       [41, 18, 25],\n",
       "       [64, 62, 24],\n",
       "       [15, 14, 16],\n",
       "       [ 7, 25, 92],\n",
       "       [69, 21, 16],\n",
       "       [91, 30, 81],\n",
       "       [21, 20, 91],\n",
       "       [93, 31, 81],\n",
       "       [38, 90, 26]])"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "array([[60, 16,  8],\n",
       "       [80, 18, 93],\n",
       "       [78,  8, 14],\n",
       "       [88, 31,  5],\n",
       "       [58, 67, 11],\n",
       "       [57, 46, 75],\n",
       "       [74, 75, 99],\n",
       "       [83, 25, 16],\n",
       "       [68, 10, 65],\n",
       "       [19, 67, 43],\n",
       "       [19, 16,  0],\n",
       "       [45, 74, 22],\n",
       "       [65, 33, 77],\n",
       "       [51, 97, 96],\n",
       "       [33,  5, 97],\n",
       "       [19, 58, 11],\n",
       "       [66, 19, 78],\n",
       "       [78, 40, 16],\n",
       "       [12, 25, 90],\n",
       "       [21, 51, 42],\n",
       "       [57,  9, 39],\n",
       "       [57, 93,  8],\n",
       "       [93, 47, 56],\n",
       "       [60, 60, 46],\n",
       "       [73, 54, 32],\n",
       "       [71, 35, 34],\n",
       "       [35, 30, 64],\n",
       "       [81, 40, 11],\n",
       "       [42, 11, 60],\n",
       "       [74, 96, 36],\n",
       "       [97, 86, 84],\n",
       "       [32, 25, 53],\n",
       "       [ 4, 94, 14],\n",
       "       [53,  9, 35],\n",
       "       [48, 59, 46],\n",
       "       [41, 85, 92],\n",
       "       [90, 70, 29],\n",
       "       [87, 93, 94],\n",
       "       [14, 92, 63],\n",
       "       [51, 12,  0],\n",
       "       [12, 65, 53],\n",
       "       [ 0, 66, 30],\n",
       "       [63,  6, 61],\n",
       "       [88, 76, 99],\n",
       "       [37, 98, 87],\n",
       "       [32, 27, 22],\n",
       "       [91,  6, 55],\n",
       "       [71, 91, 97],\n",
       "       [66, 93, 14],\n",
       "       [48, 19, 37]])"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "array([[ 0, 99, 74],\n",
       "       [54, 14, 87],\n",
       "       [84, 69,  1],\n",
       "       [50,  8, 12],\n",
       "       [75, 43, 67],\n",
       "       [64,  9, 88],\n",
       "       [46, 13, 68],\n",
       "       [58, 31, 91],\n",
       "       [ 7, 63, 89],\n",
       "       [36, 65, 32],\n",
       "       [29, 23, 97],\n",
       "       [23, 39, 31],\n",
       "       [45, 40, 64],\n",
       "       [85, 21, 94],\n",
       "       [94, 59,  0],\n",
       "       [ 6, 41, 80],\n",
       "       [69, 69, 20],\n",
       "       [98, 86, 83],\n",
       "       [72, 73, 46],\n",
       "       [ 0, 63,  7],\n",
       "       [17, 48, 11],\n",
       "       [69,  7,  5],\n",
       "       [83, 32, 81],\n",
       "       [83, 27, 45],\n",
       "       [74, 35, 13],\n",
       "       [35, 96, 39],\n",
       "       [19, 58, 48],\n",
       "       [80, 61, 19],\n",
       "       [82, 58, 15],\n",
       "       [26, 79, 44],\n",
       "       [77, 31, 65],\n",
       "       [88, 46,  9],\n",
       "       [41, 26,  2],\n",
       "       [64, 88, 42],\n",
       "       [81, 27, 39],\n",
       "       [63, 84, 60],\n",
       "       [ 7, 59, 54],\n",
       "       [92, 44, 48],\n",
       "       [ 8, 60, 73],\n",
       "       [73, 23, 74],\n",
       "       [93, 47, 38],\n",
       "       [53, 43, 87],\n",
       "       [53, 54, 85],\n",
       "       [68, 55, 95],\n",
       "       [82, 70, 76],\n",
       "       [ 6, 59, 24],\n",
       "       [49, 23,  8],\n",
       "       [33, 38, 57],\n",
       "       [22, 72, 60],\n",
       "       [35, 83, 35]])"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "array([[ 4, 91, 50],\n",
       "       [77, 30, 60],\n",
       "       [92,  1, 50],\n",
       "       [19, 43, 39],\n",
       "       [19, 15, 20],\n",
       "       [83, 22, 61],\n",
       "       [82, 76, 50],\n",
       "       [56, 41, 82],\n",
       "       [69, 23, 48],\n",
       "       [21, 34, 88],\n",
       "       [49, 91,  1],\n",
       "       [94, 69, 66],\n",
       "       [20, 69, 95],\n",
       "       [83, 48, 47],\n",
       "       [25, 61, 50],\n",
       "       [38, 21, 34],\n",
       "       [70, 81, 88],\n",
       "       [61, 64, 91],\n",
       "       [55, 63, 64],\n",
       "       [14, 71, 52],\n",
       "       [ 7, 84, 36],\n",
       "       [46, 70,  9],\n",
       "       [80, 28, 24],\n",
       "       [59, 37, 64],\n",
       "       [37, 51, 75],\n",
       "       [ 9, 73, 13],\n",
       "       [88,  2, 49],\n",
       "       [18, 14, 89],\n",
       "       [24,  9, 49],\n",
       "       [ 1, 90, 55],\n",
       "       [81, 30, 73],\n",
       "       [55, 22, 73],\n",
       "       [15, 91, 86],\n",
       "       [66, 82, 88],\n",
       "       [54, 61, 60],\n",
       "       [27, 69, 37],\n",
       "       [ 4, 26, 82],\n",
       "       [84, 27, 37],\n",
       "       [57, 10,  9],\n",
       "       [40, 26, 32],\n",
       "       [33,  3,  4],\n",
       "       [33,  6, 19],\n",
       "       [41, 82, 76],\n",
       "       [ 3, 18, 10],\n",
       "       [67, 90, 93],\n",
       "       [77, 41, 48],\n",
       "       [72, 10,  2],\n",
       "       [89,  1, 15],\n",
       "       [ 3, 13, 39],\n",
       "       [52, 16, 31]])"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "array([[90, 45, 52],\n",
       "       [37, 63, 96],\n",
       "       [93, 65, 19],\n",
       "       [11,  0, 40],\n",
       "       [12,  9, 62],\n",
       "       [70, 94, 18],\n",
       "       [93,  3, 78],\n",
       "       [47, 20, 90],\n",
       "       [60, 64, 82],\n",
       "       [69, 40, 50],\n",
       "       [55, 36, 35],\n",
       "       [75, 41, 12],\n",
       "       [37, 83, 77],\n",
       "       [66,  4, 43],\n",
       "       [68, 34, 30],\n",
       "       [ 4, 13, 43],\n",
       "       [47,  4,  7],\n",
       "       [30,  3, 14],\n",
       "       [41, 24,  0],\n",
       "       [43, 23, 40],\n",
       "       [92, 82, 22],\n",
       "       [89, 35, 90],\n",
       "       [57, 26, 73],\n",
       "       [95, 23, 82],\n",
       "       [20, 10, 60],\n",
       "       [97, 68, 78],\n",
       "       [ 6, 28, 79],\n",
       "       [ 3, 28, 56],\n",
       "       [41, 75, 19],\n",
       "       [45, 95, 65],\n",
       "       [26, 13, 57],\n",
       "       [61, 15, 12],\n",
       "       [45, 69, 27],\n",
       "       [85, 55, 45],\n",
       "       [52,  1, 90],\n",
       "       [53, 66, 96],\n",
       "       [12, 46, 33],\n",
       "       [47, 87, 44],\n",
       "       [65, 60, 26],\n",
       "       [77, 41, 92],\n",
       "       [65, 62, 50],\n",
       "       [65, 55, 15],\n",
       "       [98,  0, 54],\n",
       "       [95, 35, 47],\n",
       "       [68, 89, 97],\n",
       "       [22, 54, 61],\n",
       "       [18,  2, 92],\n",
       "       [73, 72, 29],\n",
       "       [99, 71, 26],\n",
       "       [35, 12, 68]])"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "class2 = np.random.randint(0, 100, size = (50, 3))\n",
    "class3 = np.random.randint(0, 100, size = (50, 3))\n",
    "class4 = np.random.randint(0, 100, size = (50, 3))\n",
    "class5 = np.random.randint(0, 100, size = (50, 3))\n",
    "class6 = np.random.randint(0, 100, size = (50, 3))\n",
    "display(class2, class3, class4, class5, class6)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "unnecessary-consistency",
   "metadata": {},
   "source": [
    "2.将六个班的考试成绩进行合并得到score"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "secret-elizabeth",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[39, 53, 99],\n",
       "       [60, 21, 91],\n",
       "       [66,  4, 17],\n",
       "       [79, 73, 58],\n",
       "       [56, 47,  7],\n",
       "       [80, 99, 39],\n",
       "       [99, 19, 43],\n",
       "       [ 9, 48, 50],\n",
       "       [76, 64, 55],\n",
       "       [78, 48, 46],\n",
       "       [42, 34, 45],\n",
       "       [29, 43, 21],\n",
       "       [67, 27,  1],\n",
       "       [78, 76,  5],\n",
       "       [59, 70, 95],\n",
       "       [85,  7, 19],\n",
       "       [31,  2, 10],\n",
       "       [27, 27, 98],\n",
       "       [59,  9, 53],\n",
       "       [52, 27, 83],\n",
       "       [ 7, 99, 46],\n",
       "       [95, 76, 90],\n",
       "       [40, 48, 13],\n",
       "       [78, 61, 32],\n",
       "       [25, 21, 95],\n",
       "       [55, 36, 37],\n",
       "       [77, 73, 11],\n",
       "       [83, 11,  6],\n",
       "       [30, 70, 30],\n",
       "       [20, 39, 21],\n",
       "       [90,  0, 23],\n",
       "       [21, 82, 16],\n",
       "       [18, 62, 41],\n",
       "       [67, 22,  8],\n",
       "       [90, 94, 11],\n",
       "       [ 8, 69, 22],\n",
       "       [66, 87, 89],\n",
       "       [63, 96, 22],\n",
       "       [73, 38, 81],\n",
       "       [63, 69, 87],\n",
       "       [71, 67, 41],\n",
       "       [30, 24, 68],\n",
       "       [11, 23,  9],\n",
       "       [88, 51, 68],\n",
       "       [98, 68, 26],\n",
       "       [92,  2, 89],\n",
       "       [45,  2, 14],\n",
       "       [66, 31, 98],\n",
       "       [43, 35, 31],\n",
       "       [93, 35, 69],\n",
       "       [18, 20, 99],\n",
       "       [91, 16, 77],\n",
       "       [12, 83, 81],\n",
       "       [34, 21, 69],\n",
       "       [53, 20, 83],\n",
       "       [56,  1, 56],\n",
       "       [52, 50, 66],\n",
       "       [14,  7, 26],\n",
       "       [70, 85,  6],\n",
       "       [28, 62, 48],\n",
       "       [65, 55, 19],\n",
       "       [75, 61, 57],\n",
       "       [15, 91, 38],\n",
       "       [11, 57, 19],\n",
       "       [32, 91, 93],\n",
       "       [97, 88, 47],\n",
       "       [58, 48, 19],\n",
       "       [53, 75, 74],\n",
       "       [54, 87, 28],\n",
       "       [73, 69, 43],\n",
       "       [34, 60, 18],\n",
       "       [37, 35, 33],\n",
       "       [39, 87, 90],\n",
       "       [97, 66, 42],\n",
       "       [88, 91,  8],\n",
       "       [37, 40, 84],\n",
       "       [11, 16, 29],\n",
       "       [81, 45, 77],\n",
       "       [76, 12, 78],\n",
       "       [46, 30, 73],\n",
       "       [63, 61, 57],\n",
       "       [17,  0, 95],\n",
       "       [45, 13, 57],\n",
       "       [55, 67, 53],\n",
       "       [75,  9,  7],\n",
       "       [30, 12, 90],\n",
       "       [66,  9, 95],\n",
       "       [ 6, 79, 46],\n",
       "       [76, 65, 22],\n",
       "       [11, 78, 92],\n",
       "       [83,  0, 44],\n",
       "       [41, 18, 25],\n",
       "       [64, 62, 24],\n",
       "       [15, 14, 16],\n",
       "       [ 7, 25, 92],\n",
       "       [69, 21, 16],\n",
       "       [91, 30, 81],\n",
       "       [21, 20, 91],\n",
       "       [93, 31, 81],\n",
       "       [38, 90, 26],\n",
       "       [60, 16,  8],\n",
       "       [80, 18, 93],\n",
       "       [78,  8, 14],\n",
       "       [88, 31,  5],\n",
       "       [58, 67, 11],\n",
       "       [57, 46, 75],\n",
       "       [74, 75, 99],\n",
       "       [83, 25, 16],\n",
       "       [68, 10, 65],\n",
       "       [19, 67, 43],\n",
       "       [19, 16,  0],\n",
       "       [45, 74, 22],\n",
       "       [65, 33, 77],\n",
       "       [51, 97, 96],\n",
       "       [33,  5, 97],\n",
       "       [19, 58, 11],\n",
       "       [66, 19, 78],\n",
       "       [78, 40, 16],\n",
       "       [12, 25, 90],\n",
       "       [21, 51, 42],\n",
       "       [57,  9, 39],\n",
       "       [57, 93,  8],\n",
       "       [93, 47, 56],\n",
       "       [60, 60, 46],\n",
       "       [73, 54, 32],\n",
       "       [71, 35, 34],\n",
       "       [35, 30, 64],\n",
       "       [81, 40, 11],\n",
       "       [42, 11, 60],\n",
       "       [74, 96, 36],\n",
       "       [97, 86, 84],\n",
       "       [32, 25, 53],\n",
       "       [ 4, 94, 14],\n",
       "       [53,  9, 35],\n",
       "       [48, 59, 46],\n",
       "       [41, 85, 92],\n",
       "       [90, 70, 29],\n",
       "       [87, 93, 94],\n",
       "       [14, 92, 63],\n",
       "       [51, 12,  0],\n",
       "       [12, 65, 53],\n",
       "       [ 0, 66, 30],\n",
       "       [63,  6, 61],\n",
       "       [88, 76, 99],\n",
       "       [37, 98, 87],\n",
       "       [32, 27, 22],\n",
       "       [91,  6, 55],\n",
       "       [71, 91, 97],\n",
       "       [66, 93, 14],\n",
       "       [48, 19, 37],\n",
       "       [ 0, 99, 74],\n",
       "       [54, 14, 87],\n",
       "       [84, 69,  1],\n",
       "       [50,  8, 12],\n",
       "       [75, 43, 67],\n",
       "       [64,  9, 88],\n",
       "       [46, 13, 68],\n",
       "       [58, 31, 91],\n",
       "       [ 7, 63, 89],\n",
       "       [36, 65, 32],\n",
       "       [29, 23, 97],\n",
       "       [23, 39, 31],\n",
       "       [45, 40, 64],\n",
       "       [85, 21, 94],\n",
       "       [94, 59,  0],\n",
       "       [ 6, 41, 80],\n",
       "       [69, 69, 20],\n",
       "       [98, 86, 83],\n",
       "       [72, 73, 46],\n",
       "       [ 0, 63,  7],\n",
       "       [17, 48, 11],\n",
       "       [69,  7,  5],\n",
       "       [83, 32, 81],\n",
       "       [83, 27, 45],\n",
       "       [74, 35, 13],\n",
       "       [35, 96, 39],\n",
       "       [19, 58, 48],\n",
       "       [80, 61, 19],\n",
       "       [82, 58, 15],\n",
       "       [26, 79, 44],\n",
       "       [77, 31, 65],\n",
       "       [88, 46,  9],\n",
       "       [41, 26,  2],\n",
       "       [64, 88, 42],\n",
       "       [81, 27, 39],\n",
       "       [63, 84, 60],\n",
       "       [ 7, 59, 54],\n",
       "       [92, 44, 48],\n",
       "       [ 8, 60, 73],\n",
       "       [73, 23, 74],\n",
       "       [93, 47, 38],\n",
       "       [53, 43, 87],\n",
       "       [53, 54, 85],\n",
       "       [68, 55, 95],\n",
       "       [82, 70, 76],\n",
       "       [ 6, 59, 24],\n",
       "       [49, 23,  8],\n",
       "       [33, 38, 57],\n",
       "       [22, 72, 60],\n",
       "       [35, 83, 35],\n",
       "       [ 4, 91, 50],\n",
       "       [77, 30, 60],\n",
       "       [92,  1, 50],\n",
       "       [19, 43, 39],\n",
       "       [19, 15, 20],\n",
       "       [83, 22, 61],\n",
       "       [82, 76, 50],\n",
       "       [56, 41, 82],\n",
       "       [69, 23, 48],\n",
       "       [21, 34, 88],\n",
       "       [49, 91,  1],\n",
       "       [94, 69, 66],\n",
       "       [20, 69, 95],\n",
       "       [83, 48, 47],\n",
       "       [25, 61, 50],\n",
       "       [38, 21, 34],\n",
       "       [70, 81, 88],\n",
       "       [61, 64, 91],\n",
       "       [55, 63, 64],\n",
       "       [14, 71, 52],\n",
       "       [ 7, 84, 36],\n",
       "       [46, 70,  9],\n",
       "       [80, 28, 24],\n",
       "       [59, 37, 64],\n",
       "       [37, 51, 75],\n",
       "       [ 9, 73, 13],\n",
       "       [88,  2, 49],\n",
       "       [18, 14, 89],\n",
       "       [24,  9, 49],\n",
       "       [ 1, 90, 55],\n",
       "       [81, 30, 73],\n",
       "       [55, 22, 73],\n",
       "       [15, 91, 86],\n",
       "       [66, 82, 88],\n",
       "       [54, 61, 60],\n",
       "       [27, 69, 37],\n",
       "       [ 4, 26, 82],\n",
       "       [84, 27, 37],\n",
       "       [57, 10,  9],\n",
       "       [40, 26, 32],\n",
       "       [33,  3,  4],\n",
       "       [33,  6, 19],\n",
       "       [41, 82, 76],\n",
       "       [ 3, 18, 10],\n",
       "       [67, 90, 93],\n",
       "       [77, 41, 48],\n",
       "       [72, 10,  2],\n",
       "       [89,  1, 15],\n",
       "       [ 3, 13, 39],\n",
       "       [52, 16, 31],\n",
       "       [90, 45, 52],\n",
       "       [37, 63, 96],\n",
       "       [93, 65, 19],\n",
       "       [11,  0, 40],\n",
       "       [12,  9, 62],\n",
       "       [70, 94, 18],\n",
       "       [93,  3, 78],\n",
       "       [47, 20, 90],\n",
       "       [60, 64, 82],\n",
       "       [69, 40, 50],\n",
       "       [55, 36, 35],\n",
       "       [75, 41, 12],\n",
       "       [37, 83, 77],\n",
       "       [66,  4, 43],\n",
       "       [68, 34, 30],\n",
       "       [ 4, 13, 43],\n",
       "       [47,  4,  7],\n",
       "       [30,  3, 14],\n",
       "       [41, 24,  0],\n",
       "       [43, 23, 40],\n",
       "       [92, 82, 22],\n",
       "       [89, 35, 90],\n",
       "       [57, 26, 73],\n",
       "       [95, 23, 82],\n",
       "       [20, 10, 60],\n",
       "       [97, 68, 78],\n",
       "       [ 6, 28, 79],\n",
       "       [ 3, 28, 56],\n",
       "       [41, 75, 19],\n",
       "       [45, 95, 65],\n",
       "       [26, 13, 57],\n",
       "       [61, 15, 12],\n",
       "       [45, 69, 27],\n",
       "       [85, 55, 45],\n",
       "       [52,  1, 90],\n",
       "       [53, 66, 96],\n",
       "       [12, 46, 33],\n",
       "       [47, 87, 44],\n",
       "       [65, 60, 26],\n",
       "       [77, 41, 92],\n",
       "       [65, 62, 50],\n",
       "       [65, 55, 15],\n",
       "       [98,  0, 54],\n",
       "       [95, 35, 47],\n",
       "       [68, 89, 97],\n",
       "       [22, 54, 61],\n",
       "       [18,  2, 92],\n",
       "       [73, 72, 29],\n",
       "       [99, 71, 26],\n",
       "       [35, 12, 68]])"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "score = np.vstack((class1, class2, class3, class4, class5, class6))\n",
    "score"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "heavy-herald",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(300, 3)"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "score.shape"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "modular-summer",
   "metadata": {},
   "source": [
    "3.生成性别数组sex，水平叠加数组sex和score得到data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "colonial-guidance",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[-1],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-1],\n",
       "       [-2],\n",
       "       [-1]])"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# -1表示男，-2表示女\n",
    "sex = np.random.randint(-2, 0, size = (300, 1))\n",
    "sex"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "fifteen-lewis",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[-1, 39, 53, 99],\n",
       "       [-2, 60, 21, 91],\n",
       "       [-1, 66,  4, 17],\n",
       "       ...,\n",
       "       [-1, 73, 72, 29],\n",
       "       [-2, 99, 71, 26],\n",
       "       [-1, 35, 12, 68]])"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 水平叠加sex和score\n",
    "data = np.concatenate([sex, score], axis = 1)\n",
    "data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "id": "familiar-vacuum",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(300, 4)"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.shape"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "appreciated-cooperation",
   "metadata": {},
   "source": [
    "4.分别计算男女生各科成绩统计指标：最小值、最大值、平均分、中位数、标准差"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "spread-yorkshire",
   "metadata": {},
   "source": [
    "先将男女生进行分组、切片"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "id": "commercial-yorkshire",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([-1, -2, -1, -2, -2, -2, -1, -2, -1, -2, -1, -2, -1, -1, -1, -1, -1,\n",
       "       -2, -2, -2, -1, -1, -1, -1, -1, -1, -2, -2, -2, -2, -2, -1, -2, -1,\n",
       "       -2, -1, -2, -1, -1, -2, -2, -1, -1, -2, -2, -1, -2, -2, -2, -2, -2,\n",
       "       -1, -1, -1, -2, -2, -2, -2, -2, -2, -2, -1, -1, -1, -2, -2, -1, -2,\n",
       "       -1, -1, -1, -2, -2, -1, -1, -1, -1, -1, -2, -2, -2, -2, -1, -2, -2,\n",
       "       -2, -1, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -1, -1, -1, -1, -1,\n",
       "       -2, -1, -2, -2, -2, -2, -1, -1, -1, -2, -1, -1, -2, -2, -2, -1, -1,\n",
       "       -1, -2, -1, -2, -1, -1, -1, -1, -2, -1, -2, -2, -2, -2, -2, -2, -1,\n",
       "       -1, -2, -1, -1, -2, -2, -2, -1, -1, -2, -2, -1, -1, -2, -2, -1, -2,\n",
       "       -2, -2, -1, -1, -2, -2, -1, -1, -2, -2, -2, -1, -1, -1, -1, -1, -2,\n",
       "       -2, -2, -2, -2, -2, -1, -2, -1, -1, -1, -2, -2, -1, -1, -1, -2, -2,\n",
       "       -2, -1, -2, -2, -1, -1, -1, -2, -1, -2, -2, -2, -2, -2, -1, -2, -2,\n",
       "       -1, -1, -1, -2, -2, -2, -1, -1, -2, -1, -2, -2, -1, -2, -1, -1, -1,\n",
       "       -2, -2, -2, -2, -2, -2, -2, -2, -1, -2, -2, -1, -2, -1, -1, -2, -2,\n",
       "       -2, -2, -1, -1, -2, -1, -1, -1, -1, -2, -2, -2, -1, -1, -1, -1, -1,\n",
       "       -2, -1, -1, -1, -1, -2, -2, -1, -1, -2, -2, -1, -2, -2, -1, -2, -2,\n",
       "       -2, -1, -1, -1, -2, -1, -2, -1, -2, -1, -2, -1, -1, -2, -1, -2, -2,\n",
       "       -1, -1, -2, -2, -1, -1, -1, -2, -1, -2, -1])"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "data1 = data[:, 0] # 取出每一行第一列代表性别的数字\n",
    "display(data1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "id": "foreign-sharp",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[-2, 48, 19, 37],\n",
       "       [-2, 57, 10,  9],\n",
       "       [-2, 74, 96, 36],\n",
       "       ...,\n",
       "       [-1, 71, 91, 97],\n",
       "       [-1, 71, 35, 34],\n",
       "       [-1, 35, 12, 68]])"
      ]
     },
     "execution_count": 45,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data2 = np.argsort(data1) #从小到大返回排序索引\n",
    "data3 = data[data2] #按照性别从男到女重新进行排序\n",
    "data3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "id": "distinguished-disney",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "159"
      ]
     },
     "execution_count": 48,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.min(np.argwhere(data3[:,0] == -1)) #找出性别分割点，即第一个女生所在的索引"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "id": "freelance-truck",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[-2, 48, 19, 37],\n",
       "       [-2, 57, 10,  9],\n",
       "       [-2, 74, 96, 36],\n",
       "       [-2, 97, 86, 84],\n",
       "       [-2, 32, 25, 53],\n",
       "       [-2,  4, 94, 14],\n",
       "       [-2, 53,  9, 35],\n",
       "       [-2, 48, 59, 46],\n",
       "       [-2, 84, 27, 37],\n",
       "       [-2, 81, 40, 11],\n",
       "       [-2,  4, 26, 82],\n",
       "       [-2, 12, 65, 53],\n",
       "       [-2,  0, 66, 30],\n",
       "       [-2, 63,  6, 61],\n",
       "       [-2, 66, 82, 88],\n",
       "       [-2, 32, 27, 22],\n",
       "       [-2, 91,  6, 55],\n",
       "       [-2, 55, 22, 73],\n",
       "       [-2, 81, 30, 73],\n",
       "       [-2, 87, 93, 94],\n",
       "       [-2, 40, 26, 32],\n",
       "       [-2, 41, 82, 76],\n",
       "       [-2, 93, 47, 56],\n",
       "       [-2, 64, 62, 24],\n",
       "       [-2, 15, 14, 16],\n",
       "       [-2,  7, 25, 92],\n",
       "       [-2, 69, 21, 16],\n",
       "       [-2, 91, 30, 81],\n",
       "       [-2, 70, 94, 18],\n",
       "       [-2, 19, 43, 39],\n",
       "       [-2, 58, 67, 11],\n",
       "       [-2, 57, 46, 75],\n",
       "       [-2, 74, 75, 99],\n",
       "       [-2, 83, 25, 16],\n",
       "       [-2, 52, 16, 31],\n",
       "       [-2, 45, 74, 22],\n",
       "       [-2,  3, 13, 39],\n",
       "       [-2, 89,  1, 15],\n",
       "       [-2, 33,  5, 97],\n",
       "       [-2, 19, 58, 11],\n",
       "       [-2, 66, 19, 78],\n",
       "       [-2, 57,  9, 39],\n",
       "       [-2, 99, 71, 26],\n",
       "       [-2,  0, 99, 74],\n",
       "       [-2, 84, 69,  1],\n",
       "       [-2, 50,  8, 12],\n",
       "       [-2, 88, 46,  9],\n",
       "       [-2, 38, 21, 34],\n",
       "       [-2, 25, 61, 50],\n",
       "       [-2, 63, 84, 60],\n",
       "       [-2,  7, 59, 54],\n",
       "       [-2, 92, 44, 48],\n",
       "       [-2, 20, 69, 95],\n",
       "       [-2, 73, 23, 74],\n",
       "       [-2, 93, 47, 38],\n",
       "       [-2, 21, 34, 88],\n",
       "       [-2, 82, 70, 76],\n",
       "       [-2, 69, 23, 48],\n",
       "       [-2, 49, 23,  8],\n",
       "       [-2, 33, 38, 57],\n",
       "       [-2, 22, 72, 60],\n",
       "       [-2, 35, 83, 35],\n",
       "       [-2,  4, 91, 50],\n",
       "       [-2, 56, 41, 82],\n",
       "       [-2, 92,  1, 50],\n",
       "       [-2, 77, 31, 65],\n",
       "       [-2, 41, 18, 25],\n",
       "       [-2, 61, 64, 91],\n",
       "       [-2, 74, 35, 13],\n",
       "       [-2, 75, 43, 67],\n",
       "       [-2, 24,  9, 49],\n",
       "       [-2, 18, 14, 89],\n",
       "       [-2, 58, 31, 91],\n",
       "       [-2,  7, 63, 89],\n",
       "       [-2, 88,  2, 49],\n",
       "       [-2,  9, 73, 13],\n",
       "       [-2, 23, 39, 31],\n",
       "       [-2, 45, 40, 64],\n",
       "       [-2, 85, 21, 94],\n",
       "       [-2, 37, 51, 75],\n",
       "       [-2, 59, 37, 64],\n",
       "       [-2, 80, 28, 24],\n",
       "       [-2, 46, 70,  9],\n",
       "       [-2,  0, 63,  7],\n",
       "       [-2, 17, 48, 11],\n",
       "       [-2, 69,  7,  5],\n",
       "       [-2, 83, 32, 81],\n",
       "       [-2, 83, 27, 45],\n",
       "       [-2, 19, 58, 48],\n",
       "       [-2, 83,  0, 44],\n",
       "       [-2, 78,  8, 14],\n",
       "       [-2, 76, 65, 22],\n",
       "       [-2, 18, 62, 41],\n",
       "       [-2, 90, 94, 11],\n",
       "       [-2, 26, 13, 57],\n",
       "       [-2, 66, 87, 89],\n",
       "       [-2, 41, 75, 19],\n",
       "       [-2, 63, 69, 87],\n",
       "       [-2, 71, 67, 41],\n",
       "       [-2,  6, 28, 79],\n",
       "       [-2, 45, 69, 27],\n",
       "       [-2, 88, 51, 68],\n",
       "       [-2, 45,  2, 14],\n",
       "       [-2, 66, 31, 98],\n",
       "       [-2, 11, 78, 92],\n",
       "       [-2, 93, 35, 69],\n",
       "       [-2, 18, 20, 99],\n",
       "       [-2, 57, 26, 73],\n",
       "       [-2, 53, 20, 83],\n",
       "       [-2, 56,  1, 56],\n",
       "       [-2, 98, 68, 26],\n",
       "       [-2, 52, 50, 66],\n",
       "       [-2, 90,  0, 23],\n",
       "       [-2, 30, 70, 30],\n",
       "       [-2, 60, 21, 91],\n",
       "       [-2, 79, 73, 58],\n",
       "       [-2, 56, 47,  7],\n",
       "       [-2, 80, 99, 39],\n",
       "       [-2, 18,  2, 92],\n",
       "       [-2,  9, 48, 50],\n",
       "       [-2, 78, 48, 46],\n",
       "       [-2, 29, 43, 21],\n",
       "       [-2, 20, 39, 21],\n",
       "       [-2, 98,  0, 54],\n",
       "       [-2, 27, 27, 98],\n",
       "       [-2, 59,  9, 53],\n",
       "       [-2, 52, 27, 83],\n",
       "       [-2, 65, 60, 26],\n",
       "       [-2, 47, 87, 44],\n",
       "       [-2, 53, 66, 96],\n",
       "       [-2, 77, 73, 11],\n",
       "       [-2, 83, 11,  6],\n",
       "       [-2, 65, 55, 15],\n",
       "       [-2, 14,  7, 26],\n",
       "       [-2, 43, 35, 31],\n",
       "       [-2, 28, 62, 48],\n",
       "       [-2,  4, 13, 43],\n",
       "       [-2, 37, 35, 33],\n",
       "       [-2, 39, 87, 90],\n",
       "       [-2, 68, 34, 30],\n",
       "       [-2, 70, 85,  6],\n",
       "       [-2, 55, 36, 35],\n",
       "       [-2, 30,  3, 14],\n",
       "       [-2, 76, 12, 78],\n",
       "       [-2, 63, 61, 57],\n",
       "       [-2, 17,  0, 95],\n",
       "       [-2, 55, 67, 53],\n",
       "       [-2, 75,  9,  7],\n",
       "       [-2, 30, 12, 90],\n",
       "       [-2,  6, 79, 46],\n",
       "       [-2, 46, 30, 73],\n",
       "       [-2, 53, 75, 74],\n",
       "       [-2, 75, 41, 12],\n",
       "       [-2, 65, 55, 19],\n",
       "       [-2, 92, 82, 22],\n",
       "       [-2, 89, 35, 90],\n",
       "       [-2, 41, 24,  0],\n",
       "       [-2, 97, 88, 47],\n",
       "       [-2, 32, 91, 93]])"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "array([[-1, 97, 68, 78],\n",
       "       [-1, 93, 65, 19],\n",
       "       [-1, 83, 48, 47],\n",
       "       [-1, 77, 41, 92],\n",
       "       [-1, 65, 62, 50],\n",
       "       [-1, 11,  0, 40],\n",
       "       [-1, 12,  9, 62],\n",
       "       [-1, 95, 35, 47],\n",
       "       [-1, 69, 40, 50],\n",
       "       [-1, 49, 91,  1],\n",
       "       [-1, 43, 23, 40],\n",
       "       [-1, 68, 89, 97],\n",
       "       [-1, 93,  3, 78],\n",
       "       [-1, 22, 54, 61],\n",
       "       [-1, 47, 20, 90],\n",
       "       [-1, 54, 61, 60],\n",
       "       [-1, 27, 69, 37],\n",
       "       [-1, 60, 64, 82],\n",
       "       [-1, 73, 72, 29],\n",
       "       [-1, 94, 69, 66],\n",
       "       [-1, 95, 23, 82],\n",
       "       [-1, 20, 10, 60],\n",
       "       [-1,  1, 90, 55],\n",
       "       [-1,  3, 18, 10],\n",
       "       [-1,  3, 28, 56],\n",
       "       [-1, 47,  4,  7],\n",
       "       [-1, 67, 90, 93],\n",
       "       [-1, 77, 41, 48],\n",
       "       [-1, 45, 95, 65],\n",
       "       [-1, 72, 10,  2],\n",
       "       [-1, 33,  6, 19],\n",
       "       [-1, 33,  3,  4],\n",
       "       [-1, 61, 15, 12],\n",
       "       [-1, 66,  4, 43],\n",
       "       [-1, 37, 83, 77],\n",
       "       [-1,  7, 84, 36],\n",
       "       [-1, 90, 45, 52],\n",
       "       [-1, 37, 63, 96],\n",
       "       [-1, 85, 55, 45],\n",
       "       [-1, 52,  1, 90],\n",
       "       [-1, 15, 91, 86],\n",
       "       [-1, 14, 71, 52],\n",
       "       [-1, 12, 46, 33],\n",
       "       [-1, 55, 63, 64],\n",
       "       [-1, 70, 81, 88],\n",
       "       [-1, 82, 76, 50],\n",
       "       [-1, 39, 53, 99],\n",
       "       [-1, 19, 15, 20],\n",
       "       [-1, 12, 83, 81],\n",
       "       [-1, 34, 21, 69],\n",
       "       [-1, 75, 61, 57],\n",
       "       [-1, 15, 91, 38],\n",
       "       [-1, 11, 57, 19],\n",
       "       [-1, 58, 48, 19],\n",
       "       [-1, 54, 87, 28],\n",
       "       [-1, 73, 69, 43],\n",
       "       [-1, 34, 60, 18],\n",
       "       [-1, 97, 66, 42],\n",
       "       [-1, 88, 91,  8],\n",
       "       [-1, 37, 40, 84],\n",
       "       [-1, 11, 16, 29],\n",
       "       [-1, 81, 45, 77],\n",
       "       [-1, 45, 13, 57],\n",
       "       [-1, 66,  9, 95],\n",
       "       [-1, 21, 20, 91],\n",
       "       [-1, 93, 31, 81],\n",
       "       [-1, 38, 90, 26],\n",
       "       [-1, 91, 16, 77],\n",
       "       [-1, 92,  2, 89],\n",
       "       [-1, 11, 23,  9],\n",
       "       [-1, 30, 24, 68],\n",
       "       [-1, 66,  4, 17],\n",
       "       [-1, 99, 19, 43],\n",
       "       [-1, 76, 64, 55],\n",
       "       [-1, 42, 34, 45],\n",
       "       [-1, 67, 27,  1],\n",
       "       [-1, 78, 76,  5],\n",
       "       [-1, 59, 70, 95],\n",
       "       [-1, 85,  7, 19],\n",
       "       [-1, 31,  2, 10],\n",
       "       [-1, 60, 16,  8],\n",
       "       [-1,  7, 99, 46],\n",
       "       [-1, 40, 48, 13],\n",
       "       [-1, 78, 61, 32],\n",
       "       [-1, 25, 21, 95],\n",
       "       [-1, 55, 36, 37],\n",
       "       [-1, 21, 82, 16],\n",
       "       [-1, 67, 22,  8],\n",
       "       [-1,  8, 69, 22],\n",
       "       [-1, 63, 96, 22],\n",
       "       [-1, 73, 38, 81],\n",
       "       [-1, 95, 76, 90],\n",
       "       [-1, 80, 18, 93],\n",
       "       [-1, 88, 31,  5],\n",
       "       [-1, 68, 10, 65],\n",
       "       [-1, 36, 65, 32],\n",
       "       [-1, 29, 23, 97],\n",
       "       [-1, 94, 59,  0],\n",
       "       [-1,  6, 41, 80],\n",
       "       [-1, 69, 69, 20],\n",
       "       [-1, 98, 86, 83],\n",
       "       [-1, 72, 73, 46],\n",
       "       [-1, 35, 96, 39],\n",
       "       [-1, 80, 61, 19],\n",
       "       [-1, 46, 13, 68],\n",
       "       [-1, 82, 58, 15],\n",
       "       [-1, 41, 26,  2],\n",
       "       [-1, 64, 88, 42],\n",
       "       [-1, 81, 27, 39],\n",
       "       [-1,  8, 60, 73],\n",
       "       [-1, 53, 43, 87],\n",
       "       [-1, 53, 54, 85],\n",
       "       [-1, 68, 55, 95],\n",
       "       [-1,  6, 59, 24],\n",
       "       [-1, 77, 30, 60],\n",
       "       [-1, 26, 79, 44],\n",
       "       [-1, 83, 22, 61],\n",
       "       [-1, 64,  9, 88],\n",
       "       [-1, 66, 93, 14],\n",
       "       [-1, 19, 67, 43],\n",
       "       [-1, 19, 16,  0],\n",
       "       [-1, 65, 33, 77],\n",
       "       [-1, 51, 97, 96],\n",
       "       [-1, 78, 40, 16],\n",
       "       [-1, 12, 25, 90],\n",
       "       [-1, 21, 51, 42],\n",
       "       [-1, 57, 93,  8],\n",
       "       [-1, 60, 60, 46],\n",
       "       [-1, 54, 14, 87],\n",
       "       [-1, 73, 54, 32],\n",
       "       [-1, 35, 30, 64],\n",
       "       [-1, 42, 11, 60],\n",
       "       [-1, 41, 85, 92],\n",
       "       [-1, 90, 70, 29],\n",
       "       [-1, 14, 92, 63],\n",
       "       [-1, 51, 12,  0],\n",
       "       [-1, 88, 76, 99],\n",
       "       [-1, 37, 98, 87],\n",
       "       [-1, 71, 91, 97],\n",
       "       [-1, 71, 35, 34],\n",
       "       [-1, 35, 12, 68]])"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 将男生和女生进行拆分\n",
    "male = np.split(data3, indices_or_sections= [159])[0] #男生\n",
    "female = np.split(data3, indices_or_sections= [159])[1] #女生\n",
    "display(male, female)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "id": "right-venture",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[48, 57, 74, 97, 32,  4, 53, 48, 84, 81,  4, 12,  0, 63, 66, 32,\n",
       "        91, 55, 81, 87, 40, 41, 93, 64, 15,  7, 69, 91, 70, 19, 58, 57,\n",
       "        74, 83, 52, 45,  3, 89, 33, 19, 66, 57, 99,  0, 84, 50, 88, 38,\n",
       "        25, 63,  7, 92, 20, 73, 93, 21, 82, 69, 49, 33, 22, 35,  4, 56,\n",
       "        92, 77, 41, 61, 74, 75, 24, 18, 58,  7, 88,  9, 23, 45, 85, 37,\n",
       "        59, 80, 46,  0, 17, 69, 83, 83, 19, 83, 78, 76, 18, 90, 26, 66,\n",
       "        41, 63, 71,  6, 45, 88, 45, 66, 11, 93, 18, 57, 53, 56, 98, 52,\n",
       "        90, 30, 60, 79, 56, 80, 18,  9, 78, 29, 20, 98, 27, 59, 52, 65,\n",
       "        47, 53, 77, 83, 65, 14, 43, 28,  4, 37, 39, 68, 70, 55, 30, 76,\n",
       "        63, 17, 55, 75, 30,  6, 46, 53, 75, 65, 92, 89, 41, 97, 32],\n",
       "       [19, 10, 96, 86, 25, 94,  9, 59, 27, 40, 26, 65, 66,  6, 82, 27,\n",
       "         6, 22, 30, 93, 26, 82, 47, 62, 14, 25, 21, 30, 94, 43, 67, 46,\n",
       "        75, 25, 16, 74, 13,  1,  5, 58, 19,  9, 71, 99, 69,  8, 46, 21,\n",
       "        61, 84, 59, 44, 69, 23, 47, 34, 70, 23, 23, 38, 72, 83, 91, 41,\n",
       "         1, 31, 18, 64, 35, 43,  9, 14, 31, 63,  2, 73, 39, 40, 21, 51,\n",
       "        37, 28, 70, 63, 48,  7, 32, 27, 58,  0,  8, 65, 62, 94, 13, 87,\n",
       "        75, 69, 67, 28, 69, 51,  2, 31, 78, 35, 20, 26, 20,  1, 68, 50,\n",
       "         0, 70, 21, 73, 47, 99,  2, 48, 48, 43, 39,  0, 27,  9, 27, 60,\n",
       "        87, 66, 73, 11, 55,  7, 35, 62, 13, 35, 87, 34, 85, 36,  3, 12,\n",
       "        61,  0, 67,  9, 12, 79, 30, 75, 41, 55, 82, 35, 24, 88, 91],\n",
       "       [37,  9, 36, 84, 53, 14, 35, 46, 37, 11, 82, 53, 30, 61, 88, 22,\n",
       "        55, 73, 73, 94, 32, 76, 56, 24, 16, 92, 16, 81, 18, 39, 11, 75,\n",
       "        99, 16, 31, 22, 39, 15, 97, 11, 78, 39, 26, 74,  1, 12,  9, 34,\n",
       "        50, 60, 54, 48, 95, 74, 38, 88, 76, 48,  8, 57, 60, 35, 50, 82,\n",
       "        50, 65, 25, 91, 13, 67, 49, 89, 91, 89, 49, 13, 31, 64, 94, 75,\n",
       "        64, 24,  9,  7, 11,  5, 81, 45, 48, 44, 14, 22, 41, 11, 57, 89,\n",
       "        19, 87, 41, 79, 27, 68, 14, 98, 92, 69, 99, 73, 83, 56, 26, 66,\n",
       "        23, 30, 91, 58,  7, 39, 92, 50, 46, 21, 21, 54, 98, 53, 83, 26,\n",
       "        44, 96, 11,  6, 15, 26, 31, 48, 43, 33, 90, 30,  6, 35, 14, 78,\n",
       "        57, 95, 53,  7, 90, 46, 73, 74, 12, 19, 22, 90,  0, 47, 93]])"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "array([[97, 93, 83, 77, 65, 11, 12, 95, 69, 49, 43, 68, 93, 22, 47, 54,\n",
       "        27, 60, 73, 94, 95, 20,  1,  3,  3, 47, 67, 77, 45, 72, 33, 33,\n",
       "        61, 66, 37,  7, 90, 37, 85, 52, 15, 14, 12, 55, 70, 82, 39, 19,\n",
       "        12, 34, 75, 15, 11, 58, 54, 73, 34, 97, 88, 37, 11, 81, 45, 66,\n",
       "        21, 93, 38, 91, 92, 11, 30, 66, 99, 76, 42, 67, 78, 59, 85, 31,\n",
       "        60,  7, 40, 78, 25, 55, 21, 67,  8, 63, 73, 95, 80, 88, 68, 36,\n",
       "        29, 94,  6, 69, 98, 72, 35, 80, 46, 82, 41, 64, 81,  8, 53, 53,\n",
       "        68,  6, 77, 26, 83, 64, 66, 19, 19, 65, 51, 78, 12, 21, 57, 60,\n",
       "        54, 73, 35, 42, 41, 90, 14, 51, 88, 37, 71, 71, 35],\n",
       "       [68, 65, 48, 41, 62,  0,  9, 35, 40, 91, 23, 89,  3, 54, 20, 61,\n",
       "        69, 64, 72, 69, 23, 10, 90, 18, 28,  4, 90, 41, 95, 10,  6,  3,\n",
       "        15,  4, 83, 84, 45, 63, 55,  1, 91, 71, 46, 63, 81, 76, 53, 15,\n",
       "        83, 21, 61, 91, 57, 48, 87, 69, 60, 66, 91, 40, 16, 45, 13,  9,\n",
       "        20, 31, 90, 16,  2, 23, 24,  4, 19, 64, 34, 27, 76, 70,  7,  2,\n",
       "        16, 99, 48, 61, 21, 36, 82, 22, 69, 96, 38, 76, 18, 31, 10, 65,\n",
       "        23, 59, 41, 69, 86, 73, 96, 61, 13, 58, 26, 88, 27, 60, 43, 54,\n",
       "        55, 59, 30, 79, 22,  9, 93, 67, 16, 33, 97, 40, 25, 51, 93, 60,\n",
       "        14, 54, 30, 11, 85, 70, 92, 12, 76, 98, 91, 35, 12],\n",
       "       [78, 19, 47, 92, 50, 40, 62, 47, 50,  1, 40, 97, 78, 61, 90, 60,\n",
       "        37, 82, 29, 66, 82, 60, 55, 10, 56,  7, 93, 48, 65,  2, 19,  4,\n",
       "        12, 43, 77, 36, 52, 96, 45, 90, 86, 52, 33, 64, 88, 50, 99, 20,\n",
       "        81, 69, 57, 38, 19, 19, 28, 43, 18, 42,  8, 84, 29, 77, 57, 95,\n",
       "        91, 81, 26, 77, 89,  9, 68, 17, 43, 55, 45,  1,  5, 95, 19, 10,\n",
       "         8, 46, 13, 32, 95, 37, 16,  8, 22, 22, 81, 90, 93,  5, 65, 32,\n",
       "        97,  0, 80, 20, 83, 46, 39, 19, 68, 15,  2, 42, 39, 73, 87, 85,\n",
       "        95, 24, 60, 44, 61, 88, 14, 43,  0, 77, 96, 16, 90, 42,  8, 46,\n",
       "        87, 32, 64, 60, 92, 29, 63,  0, 99, 87, 97, 34, 68]])"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "#去除性别索引，并按照科目进行汇总\n",
    "male_score = np.split(male.T, indices_or_sections= [1])[1] #男生三科汇总\n",
    "female_score = np.split(female.T, indices_or_sections= [1])[1] #女生三科汇总\n",
    "display(male_score, female_score)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "professional-electronics",
   "metadata": {},
   "source": [
    "统计男生各科成绩统计指标：最小值、最大值、平均分、中位数、标准差"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "id": "absolute-semester",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0, 0, 0])"
      ]
     },
     "execution_count": 65,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "M_min = np.min(male_score, axis=1) #男生各科成绩最小值\n",
    "M_min"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 67,
   "id": "dried-dover",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([99, 99, 99])"
      ]
     },
     "execution_count": 67,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "M_max = np.max(male_score, axis=1) #男生各科成绩最大值\n",
    "M_max"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 69,
   "id": "expected-observer",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([52.59, 43.42, 48.77])"
      ]
     },
     "execution_count": 69,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "M_avg = np.round(np.mean(male_score, axis=1), 2) #男生各科成绩平均分，取两位小数\n",
    "M_avg"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 70,
   "id": "aggressive-tower",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([56., 40., 48.])"
      ]
     },
     "execution_count": 70,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "M_median = np.median(male_score, axis=1) #男生各科成绩中位数\n",
    "M_median"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 72,
   "id": "foster-sunrise",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([27.82, 27.9 , 28.99])"
      ]
     },
     "execution_count": 72,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "M_std = np.round(np.std(male_score, axis=1), 2) #男生各科成绩标准差，取两位小数\n",
    "M_std"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "digital-roots",
   "metadata": {},
   "source": [
    "统计女生各科成绩统计指标：最小值、最大值、平均分、中位数、标准差"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 73,
   "id": "chemical-george",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([1, 0, 0])"
      ]
     },
     "execution_count": 73,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "F_min = np.min(female_score, axis=1) #女生各科成绩最小值\n",
    "F_min"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 74,
   "id": "signed-scholar",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([99, 99, 99])"
      ]
     },
     "execution_count": 74,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "F_max = np.max(female_score, axis=1) #女生各科成绩最大值\n",
    "F_max"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 75,
   "id": "union-motivation",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([53.11, 48.13, 50.65])"
      ]
     },
     "execution_count": 75,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "F_avg = np.round(np.mean(female_score, axis=1), 2) #女生各科成绩平均分，取两位小数\n",
    "F_avg"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 76,
   "id": "handed-parent",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([55., 48., 48.])"
      ]
     },
     "execution_count": 76,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "F_median = np.median(female_score, axis=1) #女生各科成绩中位数\n",
    "F_median"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 77,
   "id": "unlike-child",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([27.73, 29.39, 30.21])"
      ]
     },
     "execution_count": 77,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "F_std = np.round(np.std(female_score, axis=1), 2) #女生各科成绩标准差，取两位小数\n",
    "F_std"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "disabled-discussion",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.1"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
